package com.hkpickup.config;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Common {

	private String gAccountName=""; 
	private String gSimpleSmsPassword=""; 
	private String gSmsCalendarAddr="";
	
	public Common(){
		Properties properties = new Properties(); 
		InputStream is = this.getClass().getClassLoader().getResourceAsStream("com/hkpickup/secret/MyGoogleAccount.properties");
		try {
			properties.load(is);
			gAccountName = properties.getProperty("GmailUser", "");
			gSimpleSmsPassword = properties.getProperty("SimpleSmsPassword", "");	
			gSmsCalendarAddr = properties.getProperty("SmsCalendarAddr", "");
			is.close();
		} catch (IOException e) {
			// not handle
		}
	}	
	/**
	 * 
	 * @return gmail address
	 */
	public String getgAccountName() {
		return gAccountName;
	}

	/**
	 * 
	 * @return password for sms app.
	 */
	public String getgSimpleSmsPassword() {
		return gSimpleSmsPassword;
	}
	
	public String getgSmsCalendarAddr(){
		return gSmsCalendarAddr;		
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Common c = new Common();
		System.out.println("user " + c.getgAccountName());
		System.out.println("password " + c.getgSimpleSmsPassword());
	}

}
